<div class="btn-group">
	<a class='btn btn-primary'><?php echo $title; ?> </a>
</div>

<?php include_once 'inc_modules_path.php'; ?>
<?php include_once 'inc_ctype_index.php'; ?>

<div class="clearfix"><p></p></div>
<?php echo form_open(site_url('circle/index'),array('method'=>'get')); ?>
发布人姓名
<input type='hidden' name='c' value='<?php echo $this->cid; ?>'>
<input type='text' name='uname' value='<?php if(isset($_GET['uname']) and $_GET['uname']){ echo $_GET['uname']; } ?>'>
<input class='btn'  type='submit' value='查询' style="margin-top: -12px;">
<?php echo form_close(); ?>

<div class="boxed">
	<div class="boxed-inner seamless">

<table class="table table-striped table-hover select-list">
	<thead>
		<tr>
			<th class="width-small"><input id='selectbox-all' type="checkbox" > </th>
			<th>id</th>
			<th>发布人姓名</th>
			<th>内容</th>
			<th>评论数</th>
			<th>发布时间</th>
			<th class="span1">操作</th>
		</tr>
	</thead>
	<tbody class="sort-list">
		<?php foreach ($list as $v):?>
		<tr data-id="<?php echo $v['id'] ?>">
			<td><input class="select-it" type="checkbox" value="<?php echo $v['id']; ?>" ></td>
			<td><?php echo $v['id'] ?></td>
			<td><?php echo $v['uname'] ?></td>

			<td><?php if($v['content']!=''){echo  mb_substr(str_replace('&nbsp;','',strip_tags(userTextDecode($v['content']))),0,20,'utf-8').'...';}else{echo  mb_substr(str_replace('&nbsp;','',strip_tags(userTextDecode($v['r_content']))),0,20,'utf-8').'...';} ?></td>
			<td>
                <a href="<?php echo site_url('comments/index?c='.$this->cid.'&rid='.$v['id'].'&type=1'.'&pid=0') ?>"><?php echo $v['comments'];?></a>
            </td>
			<td> <?php echo date("Y/m/d H:i:s",$v['timeline']); ?> </td>
			<td>
				<div class="btn-group">
                    <div class="btn-group">
                        <?php //TODO:检测权限 ?>
                        <?php if ($v['audit']): ?>
                            <a href="#"  title="禁用"  class='btn btn-primary btn-small btn-ajax-audit' data-id="<?php echo $v['id'] ?>" data-audit="0">  <i class="fa fa-thumbs-up"></i> </a>
                        <?php else: ?>
                            <a href="#" title="启用" class='btn btn-small btn-ajax-audit' data-id="<?php echo $v['id'] ?>" data-audit="1"> <i class="fa fa-thumbs-down"></i> </a>
                        <?php endif ?>
                    </div>
					<a class='btn btn-small' href=" <?php echo site_urlc( $this->router->class.'/edit/'.$v['id']) ?> " title="详情"> <i class="fa fa-comments-o"></i></a>
				</div>
			</td>
		</tr>
		<?php endforeach;?>
	</tbody>
</table>

	</div>
</div>

<div class="btn-group">
	<a id='select-all' class='btn' href="#"> <i class=""></i> <?php echo lang('select_all') ?> </a>
	<a id='unselect-all' class='btn hide' href="#"> <i class=""></i> <?php echo lang('unselect') ?> </a>
	<a id="btn-audit" class='btn' href="#" data-audit='1'>启用</a>
	<a id="btn-audit" class='btn' href="#"  data-audit='0'>禁用</a>
</div>

<?php echo $pages; ?>

<script>
require(['adminer/js/ui'],function(ui){
	var circle = {
		url_audit: "<?php echo site_urlc('circle/audit'); ?>"
	};
	ui.btn_audit(circle.url_audit);	// 审核
});
</script>
